﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NutriLeaf.Web.Core.Message
{
    public interface IMessage
    {
        void SendMessage(string messageText,int sentUserId,int receivedUserId,ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        void ReplyToMessage(string messageText, int sentUserId, int receivedUserId, int replyMessageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        bool IsMessageRead(int messageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        void MarkMessageAsRead(int messageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        void MarkMessageAsRead(Model.Message message, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        void MarkMessagesAsRead(List<int> messageIds, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        void MarkMessagesAsRead(List<Model.Message> messages, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        Model.Message GetMessage(int messageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetMessageThread(int messageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context); //get message with all the replies

        List<Model.Message> GetAllMessagesForThisUser(int sendUserId, int receivedUserId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetSentMessages(int userId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetReceivedMessages(int userId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetUnreadMessages(int userId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetSentMessages(int userId, DateTime datetime, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetReceivedMessages(int userId, DateTime datetime, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetUnreadMessages(int userId, DateTime datetime, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetSentMessages(int userId, DateTime datetimeStart, DateTime datetimeEnd, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetReceivedMessages(int userId, DateTime datetimeStart, DateTime datetimeEnd, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        List<Model.Message> GetUnreadMessages(int userId, DateTime datetimeStart, DateTime datetimeEnd, ref NutriLeaf.Web.Model.NutriLeafDBEntities context);

        void DeleteMessageThread(int messageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context); //deletes the message with the replies

        void DeleteMessage(int messageId, ref NutriLeaf.Web.Model.NutriLeafDBEntities context); //deletes particular message

    }
}